import dayjs from 'dayjs'

const week: Record<string, string> = {
  0: '天',
  1: '一',
  2: '二',
  3: '三',
  4: '四',
  5: '五',
  6: '六',
}

export function useClock() {
  const date = Date.now()
  return `${dayjs(date).format('hh:mm A')}`
}

export function useDate() {
  const date = Date.now()
  return `${dayjs(date).format('MM月DD日')}`
}

export function useWeek() {
  const date = Date.now()
  return '星期' + week[`${dayjs(date).format('d')}`]
}
